home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- set the colorDepth to 16
- initMovieSprite()
- initMemory()
- loadPatches()
- end
-
- on initMovieSprite
- global theMovie, currenRate, zoomDirection, zoomState
- set currentRate to 0
- set zoomDirection to -1
- set zoomState to 3
- set theMovie to 10
- puppetSprite(10, 1)
- set the stretch of sprite 10 to 1
- set the immediate of sprite 10 to 1
- set the height of sprite theMovie to zoomState * 120
- set the width of sprite theMovie to zoomState * 160
- end
-
- on initPatches
- global thePatch, theMovie
- set thePatch to []
- set theDur to 1
- if the castType of cast theMovie = #digitalVideo then
- set theDur to the duration of cast 10
- end if
- repeat with t = 1 to 127
- setAt(thePatch, t, birth(script "patch", 0, theDur, 1))
- end repeat
- end
-
- on loadPatches
- global theMovie, thePatch, theCurrentPatch
- if the castType of cast theMovie = #digitalVideo then
- set theGroup to ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "z", "x", "c", "v", "b", "n", "m", ",", ".", "/"]
- initPatches()
- set theCurrentPatch to getAt(thePatch, charToNum("+"))
- set theLength to the duration of cast theMovie / 10
- repeat with t = 1 to 10
- set theStart to (t - 1) * theLength
- set theEnd to (t * theLength) - 1
- if (theEnd - theStart) < 45 then
- set theEnd to theStart + 45
- end if
- if (theEnd - theStart) > 150 then
- set theEnd to theStart + 150
- end if
- if theEnd > the duration of cast theMovie then
- set theEnd to the duration of cast theMovie
- end if
- set theCurrent to getAt(thePatch, charToNum(getAt(theGroup, t)))
- set the startpt of theCurrent to theStart
- set the endpt of theCurrent to theEnd
- set the looptype of theCurrent to 0
- set theCurrent to getAt(thePatch, charToNum(getAt(theGroup, t + 10)))
- set the startpt of theCurrent to theStart
- set the endpt of theCurrent to theEnd
- set the looptype of theCurrent to 1
- set theCurrent to getAt(thePatch, charToNum(getAt(theGroup, t + 20)))
- set the startpt of theCurrent to theStart
- set the endpt of theCurrent to theEnd
- set the looptype of theCurrent to -1
- set theCurrent to getAt(thePatch, charToNum(getAt(theGroup, t + 30)))
- set the startpt of theCurrent to theStart
- set the endpt of theCurrent to theEnd
- set the looptype of theCurrent to 2
- end repeat
- end if
- end
-
- on waitforloadmovie
- global theMovie
- set the keyDownScript to EMPTY
- set theMovieCast to the castNum of sprite theMovie
- if theMovieCast > 0 then
- if the castType of cast theMovieCast = #digitalVideo then
- go("play")
- else
- go("nomovie")
- end if
- else
- go("nomovie")
- end if
- end
-
- on myFrameHook
- global theCurrentPatch
- checkLoop(theCurrentPatch)
- go(the frame)
- end
-
- on initMemory
- global theMovie
- if the castType of cast theMovie = #digitalVideo then
- unLoadCast(theMovie)
- preLoadCast(theMovie)
- end if
- end
-
- on setNewRate theNewRate
- global currentRate, theMovie
- set the movieRate of sprite theMovie to theNewRate
- updateStage()
- set currentRate to theNewRate
- end
-
- on IMPkeydown
- global theCurrentPatch, thePatch, currentRate
- if the key = "[" then
- setNewRate(-1 * abs(currentRate))
- else
- if the key = "]" then
- setNewRate(abs(currentRate))
- else
- if the key = "-" then
- setNewRate(0.89999999999999991 * currentRate)
- else
- if the key = "=" then
- setNewRate(1.09999999999999987 * currentRate)
- else
- if not (the optionDown or the commandDown or the controlDown) then
- set theCurrentPatch to getAt(thePatch, charToNum(the key))
- playPatch(theCurrentPatch)
- end if
- end if
- end if
- end if
- end if
- dontPassEvent()
- end
-
- on loadMovie
- global theMovie
- go("nomovie")
- initMovieSprite()
- set theFileRef to EMPTY
- set theFileRef to FileIO(mnew, "?read", "MooV")
- if objectp(theFileRef) then
- cursor(4)
- importFileInto(cast theMovie, theFileRef(mFileName))
- set the preLoad of cast theMovie to 1
- set the directToStage of cast theMovie to 1
- set the loop of cast theMovie to 0
- set the pausedAtStart of cast theMovie to 1
- set the controller of cast theMovie to 0
- updateStage()
- initMemory()
- loadPatches()
- cursor(0)
- else
- updateStage()
- end if
- end
-
- on zoomMovie
- global theMovie, zoomDirection, zoomState
- set zoomState to zoomState + zoomDirection
- if zoomState <= 1 then
- set zoomState to 1
- set zoomDirection to 1
- else
- if zoomState >= 3 then
- set zoomState to 3
- set zoomDirection to -1
- end if
- end if
- set the height of sprite theMovie to 120 * zoomState
- set the width of sprite theMovie to 160 * zoomState
- puppetTransition(47, 1, 10, 1)
- set the visible of sprite theMovie to 0
- updateStage()
- set the visible of sprite theMovie to 1
- end
-
- on handleEBN
- global theMovie, theHoldRate
- set the keyDownScript to EMPTY
- puppetSprite(theMovie, 0)
- go("ebn")
- end
-
- on handleAbout
- global theMovie, theHoldRate
- set the keyDownScript to EMPTY
- puppetSprite(theMovie, 0)
- go("about")
- end
-
- on handleOK
- global theMovie
- go("nomovie")
- initMovieSprite()
- end
-